//app.js
App({
  onLaunch: function () {
    var that = this;
    //调用API从本地缓存中获取数据

    

    wx.login({
      success: function (rs) {
        if (rs.code) {
          
          wx.setStorageSync('login_code', rs.code)

        }
        wx.getUserInfo({
          success: function (res) {
           // that.globalData.userInfo = res.userInfo
            wx.setStorageSync('userInfo', res.userInfo)
          }
        })
      }
    })
  },
  
  globalData:{
    userInfo:null,

    login_code:null, 
    api_url:"https://xcx.7lifa.com/"
  }
})